N of M style page numbers

Some document writers prefer the pages to be numbered as n of m where m is the number of pages in the document. There is a package nofm.sty available, but some versions of it are defective, and most don't work with fancyheadings because they take over the complete page layout. For LATEX2e there is a package lastpage available which you can use with fancyheadings as follows:

\usepackage{lastpage}
...
\cfoot{\thepage\ of \pageref{LastPage}}

If you are still using 2.09 and you are not able to switch to LATEX2e you can define a 2.09 compatible lastpage.sty as follows:

\let\origenddocument=\enddocument
\def\enddocument{\clearpage\if@filesw
  {\addtocounter{page}{-1} \immediate\write\@mainaux
    {\string\newlabel{LastPage}{{}{\thepage}}}}\origenddocument}

With some trickery7 the value of the LastPage label can be used to make different headers or footers on the last page of a document. E.g. if you want the footer of every odd page, except if it is the last one, to contain the text ``please turn over'', this can be done as follows:

\usepackage{lastpage}
\usepackage{ifthen}
...
\makeatletter
\def\LastPagenum{\@ifundefined{r@LastPage}{0}{\expandafter
    \expandafter\expandafter\@cdr
    \csname r@LastPage\endcsname\@nil\null} }
\makeatother
\rfoot{\ifthenelse{\isodd{\value{page}} \and \not
    \value{page}=\LastPagenum}{please turn over}{}}